{% extends 'indexTemplate.html' %}

{% load staticfiles %}

{% block title %}课程信息列表 - 慕学在线网{% endblock %}

{% block customBread %}
<section>
    <div class="wp">
        <ul  class="crumbs">
            <li><a href="{% url 'index' %}">首页</a>></li>
            <li>公开课</li>
        </ul>
    </div>
</section>
{% endblock %}

{% block content %}
<section>
	<div class="wp">
		<div class="list" style="margin-top:0;">
			<div class="left layout">
				<div class="head">
					<ul class="tab_header">
						<li {% ifequal sort "addTime" %}class="active"{% endifequal %}>
                            <a href="?sort=addTime">最新</a>
                        </li>
						<li {% ifequal sort "clickNum" %}class="active"{% endifequal %}>
                            <a href="?sort=clickNum">最热门</a>
                        </li>
						<li {% ifequal sort "students" %}class="active"{% endifequal %}>
                            <a href="?sort=students">参与人数</a>
                        </li>
					</ul>
				</div>
                <div id="inWindow">
                    <div class="tab_cont " id="content">
                        <div class="group_list">
                        {% for obj in pageObj.object_list %}
                            <div class="box">
                                <a href="{% url 'courses:courseDetail' obj.id %}">
                                    <img width="280" height="350" class="scrollLoading" src="{{ MEDIA_URL }}{{ obj.images }}"/>
                                </a>
                                <div class="des">
                                    <a href="{% url 'courses:courseDetail' obj.id %}">
                                        <h2>{{ obj.name }}</h2>
                                    </a>
                                    <span class="fl">时长：<i class="key">{{ obj.learnTimes }}</i></span>
                                    <span class="fr">学习人数：{{ obj.students }}&nbsp;&nbsp;</span>
                                </div>
                                <div class="bottom">
                                    <a href="courseDetail.html">
                                        <span class="fl">来自慕课网</span>
                                    </a>
                                    <span class="star fr  notlogin" data-favid="15">
                                        {{ obj.favNum }}
                                    </span>
                                </div>
                            </div>
                        {% endfor %}
                        </div>
                        <div class="pageturn">
                            <ul class="pagelist">
                            {% if pageObj.has_previous %}
                                <li class="long">
                                    <a href="?{{ pageObj.previous_page_number.querystring }}">上一页</a>
                                </li>
                            {% endif %}
                            {% if pageObj.object_list|length > 0 %}
                                {% for page in pageObj.pages %}
                                    {% if page %}
                                        {% ifequal page pageObj.number %}
                                        <li class="active">
                                            <a class="page" href="?{{ page.querystring }}">{{ page }}</a>
                                        </li>
                                        {% else %}
                                        <li>
                                            <a class="page" href="?{{ page.querystring }}">{{ page }}</a>
                                        </li>
                                        {% endifequal %}
                                    {% else %}
                                        <li><a href="#" class="none">...</a></li>
                                    {% endif %}
                                {% endfor %}
                            {% endif %}
                            {% if pageObj.has_next %}
                                <li class="long"><a href="?{{ pageObj.next_page_number.querystring }}">下一页</a></li>
                            {% endif %}
                            </ul>
                        </div>
				    </div>
                </div>
			</div>

			<div class="right layout">
				<div class="head">热门课程推荐</div>
				<div class="group_recommend">
                {% for courseHot in coursesHot %}
                    <dl>
                        <dt>
                            <a target="_blank" href="">
                                <img width="240" height="220" class="scrollLoading" src="{{ MEDIA_URL }}{{ courseHot.images }}"/>
                            </a>
                        </dt>
                        <dd>
                            <a target="_blank" href="">
                                <h2>{{ courseHot.name }}</h2>
                            </a>
                            <span class="fl">难度：
                                <i class="key">{{ courseHot.get_degree_display }}</i>
                            </span>
                        </dd>
                    </dl>
                {% endfor %}
				</div>
			</div>

		</div>
	</div>
</section>
{% endblock %}

